<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>我的生活</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <link rel="shortcut icon" href="/favicon.ico">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
    <link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm-extend.min.css">
    <link rel="stylesheet" type="text/css" href="css/books.css">
    <script type='text/javascript' src='http://g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm-extend.min.js' charset='utf-8'></script>
     <script type='text/javascript' src='js/utils.js'></script>

  </head>
  <body>
    <div class="page-group">
        <div class="page">
            <header class="bar bar-nav" style="background:rgba(57,117,157,1);">
            <h1 class="title" style="color:white;font-size:18px;" id="Mybook"></h1>
            <a href="#">
               <label class="share">分享</label>
            </a>
            </header>
            <nav class="bar bar-tab">
                <a class="tab-item external" href="#">
                    <span class="icon icon-home"></span>
                    <span class="tab-label">加入书架</span>
                </a>
                <a class="tab-item external" id="reading" href="#">
                    <span class="tab-label">开始阅读</span>
                </a>
                <a class="tab-item external" href="#" id="Mycollect">
                    <span class="icon icon-star" id="star"></span>
                    <span class="tab-label" id="collect">收藏</span>
                </a>
                
            </nav>
            <div class="content">
                <div class="content-block">
                    <div>
                        <img id="image" src="" class="image" width="100" height="132">
                        <div id="massage">
                            <label id="bookname"></label>
                            <label id="author"></label>
                        </div>
                    </div>
                    <div id="content">
                        <p id="introduce">
                           
                        </p>
                    </div>
                </div>
            </div>
        </div>

    </div>
    <script>$.init()</script>    
    <script>
        window.onload=function () {
        	var Mycollect=document.getElementById("Mycollect");
        	var star=document.getElementById("star");
        	var collect=document.getElementById("collect");
            var isClicked = false;
            Mycollect.onclick=function () {
            	if (!isClicked) {
            		collect.style.color = 'rgba(114,184,230,1)';
            		isClicked=true;
            	}
            	else {
            		collect.style.color = 'rgba(197,197,198,1)';
            		isClicked=false;
            	}
            }
        }
    </script>
    <script type="text/javascript">
    	$(document).ready(function () {
            var username = $('#name').val();
            var password = $('#password').val();



            AjaxIO.post("/getEbookJson", {loginId: username, password: password},
                         function (result) {
                         	$('#image').attr("src",result[0].data.imageUrl);
                         	$('#Mybook').html(result[0].data.bookName);
                         	$('#bookname').html(result[0].data.bookName);
                         	$('#author').html(result[0].data.author);
                         	$('#introduce').html(result[0].data.review);
                  
            });
    	})
    </script>

  </body>
</html>
